package com.smart.mip.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;


/**
 * create by scaffold 2017-07-18 
 * @author codefan@sina.com
 
  操作定义null   
*/
@Entity
@Table(name = "F_OPT_DEF")
public class OptDef implements java.io.Serializable {
	private static final long serialVersionUID =  1L;



	/**
	 * 操作代码 null 
	 */
	@Id
	@Column(name = "OPT_CODE")
	@GeneratedValue(generator = "assignedGenerator")
	@GenericGenerator(name = "assignedGenerator", strategy = "uuid")
	private String optCode;

	/**
	 * 操作名称 null 
	 */
	@Column(name = "OPT_NAME")
	@Length(max = 100, message = "字段长度不能大于{max}")
	private String  optName;
	/**
	 * 操作方法 操作参数 方法 
	 */
	@Column(name = "OPT_METHOD")
	@Length(max = 50, message = "字段长度不能大于{max}")
	private String  optMethod;
	/**
	 * 创建时间 null 
	 */
	@Column(name = "CreateDate")
	private Date  createdate;


	// Constructors
	/** default constructor */
	public OptDef() {
		super();
	}
	/** minimal constructor */
	public OptDef(
		String optCode		
		) {
	
	
		this.optCode = optCode;		
			
	}

/** full constructor */
	public OptDef(
	 String optCode		
	,String  optName,String  optMethod,Date  createdate) {
	
	
		this.optCode = optCode;		
	
		this.optName= optName;
		this.optMethod= optMethod;
		this.createdate= createdate;		
	}
	

  
	public String getOptCode() {
		return this.optCode;
	}

	public void setOptCode(String optCode) {
		this.optCode = optCode;
	}
	// Property accessors
  
	public String getOptName() {
		return this.optName;
	}
	
	public void setOptName(String optName) {
		this.optName = optName;
	}
  
	public String getOptMethod() {
		return this.optMethod;
	}
	
	public void setOptMethod(String optMethod) {
		this.optMethod = optMethod;
	}
  
	public Date getCreatedate() {
		return this.createdate;
	}
	
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	
public OptDef copy(OptDef other){
  
		this.setOptCode(other.getOptCode());
  
		this.optName= other.getOptName();  
		this.optMethod= other.getOptMethod();  
		this.createdate= other.getCreatedate();

		return this;
	}
	
	public OptDef copyNotNullProperty(OptDef other){
  
	if( other.getOptCode() != null){
	this.setOptCode(other.getOptCode());}
  
		if( other.getOptName() != null)
			this.optName= other.getOptName();  
		if( other.getOptMethod() != null)
			this.optMethod= other.getOptMethod();  
		if( other.getCreatedate() != null)
			this.createdate= other.getCreatedate();		

		return this;
	}

	public OptDef clearProperties(){
  
		this.optName= null;  
		this.optMethod= null;  
		this.createdate= null;

		return this;
	}
}
